﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business.ApplicationSecurity;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Crypto
            //byte[] s = Business.Crypto.Symmetrical.EncryptText("Ce mai faci", "aaaa");
            //string o = Business.Crypto.Symmetrical.DecryptText(s, "aaaa");

            //byte[] s = Business.Crypto.Asymmetrical.Encrypt("Salut");
            //string a = Business.Crypto.Asymmetrical.Decrypt(s);

            //string hash = Business.Crypto.HashingAlg.GetHash("Mihai");
            //string hashFile = Business.Crypto.HashingAlg.GetHash(new System.IO.FileStream("c:\\config.sys",  System.IO.FileMode.Open, System.IO.FileAccess.Read));

            //string s1 = Business.Crypto.HashKeyAlg.GetHash("ceva", "mihai");
            //Console.WriteLine(s1);

            //string s2 = Business.Crypto.HashKeyAlg.GetHash("asta este", "mihai");
            //Console.WriteLine(s2);
            //Business.Crypto.SigningFiles.Sing();
            //Business.Crypto.SigningFiles.Sing2(); 
            #endregion

            #region Authentication & Authorization
            //Business.AutheAuthor.BasicStuff.DoBasicStuff();
            //Business.AutheAuthor.PrincipalPerm.PrincipalPermisionDemo();
            //Business.AutheAuthor.ACLExamples.DoACLExamples(); 
            #endregion

            #region Declarative Security to Protect Assembly
            //DeclarativeSecurityAssembly.FileRead_WithoutError();
            //DeclarativeSecurityAssembly.FileRead_WithError();
            #endregion

            #region Declarative Security to Protect Methods
            //Declarative_Imprerative_Security_to_Protect_Methods.CreateProgramFolder(); 
            //Declarative_Imperative_Security_to_Protect_Methods.RequestWebPage_Declarative();
            //Declarative_Imperative_Security_to_Protect_Methods.CreateProgramFolder_Imperative();
            //Declarative_Imperative_Security_to_Protect_Methods.RequestWebPage_Imperative();

            //Analyze Granted Permission
            Analyze_Granted_Permissions.Check();
            #endregion

            

            Console.ReadKey();


        }
    }
}
